﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MS.INV.Prices
{
    public partial class PriceList : Lib.Bases.Forms.BaseForm
    {
        PriceBasic basic = new PriceBasic();
        Price_ByLocation location = new Price_ByLocation();

        public PriceList()
        {
            InitializeComponent();
        }

        private void PriceList_Load(object sender, EventArgs e)
        {
            tabBasic.Controls.Add(basic);
            basic.Location = new Point(1, 1);
            basic.Dock = DockStyle.Fill;
            basic.Show();
            
            tabLocation.Controls.Add(location);
            location.Location = new Point(1, 1);
            location.Dock = DockStyle.Fill;
            location.Show();
        }

        private void btApply_Click(object sender, EventArgs e)
        {
            try
            {
                basic.OnUpdate();
                location.OnUpdate();

                MessageBox.Show("Dữ liệu thay đổi đã được cập nhật thành công.");
            }
            catch (Exception ex)
            {
                Lib.Bases.SysError.RaiseError(ex, this.Name, "Update data");
            }
        }

        private void btClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
